import React, { useEffect, useState, } from 'react';
import { RightOutlined,LeftOutlined } from '@ant-design/icons';
import { getUser2Djm } from '../../api/api';
import { Link } from 'react-router-dom';

export default function Geren() {
  const [user,setUser]  = useState({})
  const phone = sessionStorage.getItem('user')
  useEffect(()=>{
    getUser2Djm(phone).then(res=>setUser(res.data))
  },[])
  return (
    <div>
      <header style={{display:'flex',alignItems: 'center',justifyContent: 'space-between',padding:'0 10px',height:'50px'}}>
        <LeftOutlined onClick={()=>{
            window.history.back()
          }}/>
        <h4>个人信息</h4>
        <div> </div>
      </header>
      <div style={{width:'100%',height:'50px',display:'flex',alignItems: 'center',justifyContent: 'space-around'}}>
        <div style={{width:'56%'}}>头像</div>
        <div style={{width:'45px',height:'45px',borderRadius:'50%',overflow:'hidden'}} ><img src={user.img} alt="" style={{width:'100%',height:'100%'}}/></div>
        <RightOutlined />
      </div>
      <Link to="/nicheng" style={{color:'black',textDecoration:'none'}}>
        <div style={{width:'100%',height:'50px',display:'flex',alignItems: 'center',justifyContent: 'space-around'}}>
          <div style={{width:'56%'}}>昵称</div>
          <div style={{width:'45px'}}>{user.userName}</div>
          <RightOutlined />
        </div>
      </Link>
      
    </div>
  )
}
